package yagwl.client.model;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

/**
 * TODO java doc
 */
public class FilterEvent extends GwtEvent<FilterEvent.FilterEventHandler> {

  public static final Type<FilterEventHandler> TYPE = new Type<FilterEventHandler>();

  private FilteredItemListCache filteredListCache;

  FilterEvent(FilteredItemListCache filteredListCache) {
    super();
    this.filteredListCache = filteredListCache;
  }

  public FilteredItemListCache getFilteredListCache() {
    return filteredListCache;
  }

  @Override
  protected void dispatch(FilterEventHandler handler) {
    handler.onFilterEvent(this);
  }

  @Override
  public GwtEvent.Type<FilterEventHandler> getAssociatedType() {
    return TYPE;
  }

  public interface FilterEventHandler extends EventHandler {
    public void onFilterEvent(FilterEvent event);
  }

}
